using System;
using System.Collections.Generic;
using System.Linq;
using RMH.Entities;
using RMH.Services;

namespace RMH.Web.FakeServices
{
    public class FakeStayService : IStayService
    {
        private static List<Stay> _stay = new List<Stay>
                                                {
                                                    new Stay() {Id = 1, Patient = (new FakePatientService()).Get(1), CheckinDate = new DateTime(2009,4,22), Room = (new FakeRoomService()).Get(4)},
                                                    new Stay() {Id = 2, Patient = (new FakePatientService()).Get(5), CheckinDate = new DateTime(2009,4,24), Room = (new FakeRoomService()).Get(3)},
                                                    new Stay() {Id = 2, Patient = (new FakePatientService()).Get(2), CheckinDate = new DateTime(2009,4,23), Room = (new FakeRoomService()).Get(1)}
                                                };
        public IList<Stay> GetCurrent()
        {
            return _stay;
        }

        public Stay Get(int id)
        {
            return _stay.Where(s => s.Id == id).FirstOrDefault();
        }

        public void Save(Stay stay)
        {
            throw new NotImplementedException();
        }

        public IList<Stay> GetAll()
        {
            return _stay;
        }

		public IList<Stay> GetByDateRange(System.DateTime start, System.DateTime end) {
			return _stay.Where(s => s.CheckinDate >= start && s.CheckinDate <= end).ToList();
		}

    }
}